//
//  ServeTableViewCell.m
//  jizhiyunduan
//
//  Created by 鞠超 on 16/4/25.
//  Copyright © 2016年 JC. All rights reserved.
//

#import "ServeTableViewCell.h"

@implementation ServeTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image = [[UIImageView alloc] init];
    self.image.layer.masksToBounds = YES;
    self.image.layer.cornerRadius = 30;
    self.image.backgroundColor = [UIColor orangeColor];
    
    [self.contentView addSubview:self.image];
    
    
    self.name = [[UILabel alloc] init];
    self.name.text = @"SEO优化";
    self.name.font = [UIFont systemFontOfSize:15];
//    self.name.backgroundColor = [UIColor orangeColor];
    
    [self.contentView addSubview:self.name];
    
    
    self.detail = [[UITextView alloc] init];
    self.detail.text = @"SEO优化服务的好处SEO优化服务的好处好处SEO优化服务的好处";
    self.detail.textColor = [UIColor grayColor];
    self.detail.font = [UIFont systemFontOfSize:13];
    self.detail.userInteractionEnabled = NO;
//    self.detail.backgroundColor = [UIColor orangeColor];
    
    [self.contentView addSubview:self.detail];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image.frame = CGRectMake(10, 10, 60, 60);
    
    self.name.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 10, 10, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 20, 20);
    
    self.detail.frame = CGRectMake(CGRectGetMaxX(self.image.frame) + 7, CGRectGetMaxY(self.name.frame) + 0, SCREEN_WIDTH - CGRectGetMaxX(self.image.frame) - 20, 45);
}



@end
